// 导出搜索状态管理
export {
  useSearchStore,
  useSearchQuery,
  useSearchResults,
  useSearchSuggestions,
  useSearchLoading,
  useSearchError,
  useSearchHistory,
  useSearchFilters,
  useSearchPagination,
  useSearchStats,
  useSearchActions,
} from './useSearchStore';

// 导出应用状态管理
export {
  useAppStore,
  useTheme,
  useLanguage,
  useDeviceType,
  useNetworkStatus,
  useSidebarState,
  useModals,
  useNotifications,
  usePreferences,
  useAppStatus,
  useAppActions,
  initializeAppStore,
} from './useAppStore';

// 导出 React Query 相关
export {
  queryClient,
  queryKeys,
  queryUtils,
  offlineUtils,
} from '../services/queryClient';

// 创建统一的状态管理初始化函数
export function initializeStores() {
  // Import and call the initialization function
  import('./useAppStore').then(({ initializeAppStore }) => {
    initializeAppStore();
  });
}

// 创建统一的状态重置函数
export async function resetAllStores() {
  // Import stores dynamically to avoid circular dependencies
  const [
    { useSearchStore },
    { useAppStore },
    { queryClient }
  ] = await Promise.all([
    import('./useSearchStore'),
    import('./useAppStore'),
    import('../services/queryClient')
  ]);

  useSearchStore.getState().reset();
  useAppStore.getState().reset();
  queryClient.clear();
}
